package com.pojo;

import java.util.Objects;

/**
 * ClassName : User
 * Package : com.pojo
 * Description :
 *
 * Author: LHZ
 * Create: 2025/5/18 19:28
 * Version: 1.0
 */
public class User {
    private int uid;
    private String name;
    private int age;
    private String address;
    public User(){

    }
    public User(String name, int age){
        this.age=age;
        this.name=name;
    }

    public int getUid() {
        return uid;
    }

    public void setUid(int uid) {
        this.uid = uid;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        this.age = age;
    }

    public String getAddress() {
        return address;
    }

    public void setAddress(String address) {
        this.address = address;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        User user = (User) o;
        return uid == user.uid && age == user.age && Objects.equals(name, user.name) && Objects.equals(address, user.address);
    }

    @Override
    public int hashCode() {
        return Objects.hash(uid, name, age, address);
    }

    public void show1(){
        System.out.println("User.show.master after update");
    }

    @Override
    public String toString() {
        return "User{" +
                "name='" + name + '\'' +
                ", age=" + age +
                '}';
    }
}